#include <cstdio>
#include <vector>
#include <string>
#include <cassert>

using namespace std;

typedef vector<string> VS;
const int MAX = 100000;
vector<int> v[MAX];
int n, m;

VS SplitNotNull(string s, string c)
{
	s += c;
	VS result;
	string tec = "";
	int i;
	for (i=0;i<s.length();i++)
	{
		if ( c.find(s[i])!=-1 ) 
		{
			if ( tec.length()>0 ) result.push_back(tec);
			tec = "";
		}
		else tec += s[i];
	}
	return result;
}

void Read()
{
	scanf("%d %d", &n, &m);
	char buf[10000];
	gets(buf);
	int kol = 0;
	for (int i=0;i<n;i++)
	{
		gets(buf);
		VS tmp = SplitNotNull(string(buf), " ");
		for (int j=0;j<(int)tmp.size();j++)
		{
			int kk;
			sscanf(tmp[j].c_str(), "%d", &kk);
			v[i].push_back(kk-1);
			kol++;
		}
	}
	
	assert(kol/2 == m);
}

void Write()
{
	printf("<?xml version='1.0' encoding='UTF-8' standalone='no'?>\n");
	printf("<grpahml >\n");
	printf("<graph directed='false' id='insert here!'>\n");
	
	for (int i=0;i<n;i++)
		printf("	<node id='%d' />\n", i);

	printf("\n");	
	for (int i=0;i<n;i++)
	{
		for (int j=0;j<(int)v[i].size();j++)
			printf("	<edge source='%d' target='%d'/>\n", i, v[i][j]);
	}
	
	printf("</graph>\n");
	printf("</grpahml>\n");
	
}

int main()
{
	Read();
	Write();
	return 0;
}
